#include <stdio.h>
int main()
{
    char c[100];
    int i=0;
    gets(c);
    for(int i=0;c[i]!='#';i++){
        if(c[i]>='a'&&c[i]<='z'){
            c[i]=c[i]-32;
        }
        else if(c[i]>='A'&&c[i]<='Z'){
        	c[i]=c[i]+32;
		}else{
			c[i]=c[i];
		}
        printf("%c",c[i]);
    }
    
    return 0;
}
